package com.wtt.service;

import com.wtt.domain.Girl;
import com.wtt.repository.GirlRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by wutaotao
 * 2018/1/6 22:37
 */

@Service
public class GirlService {

    @Autowired
    private GirlRepository girlRepository;

    @Transactional
    public void insertTwo(){
        Girl girl = new Girl();
        girl.setAge(10);
        girl.setCupSize("BBB");
        girlRepository.save(girl);

        Girl girl2 = new Girl();
        //表中字段为2位
        girl2.setAge(24);
        girl2.setCupSize("D");
        girlRepository.save(girl2);
    }
}
